import 'dart:developer';

import 'package:fate_blind_box/chat_pages/home/logic.dart';
import 'package:fate_blind_box/utils/privte_dialog.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shared_preferences/shared_preferences.dart';

import 'state.dart';

class LoginLogic extends GetxController {
  final LoginState state = LoginState();

  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
    initAgreement();
  }

  initAgreement() async {
    SharedPreferences prefs = await SharedPreferences.getInstance();
    var privacyPolicyDialog = prefs.getBool('PrivacyPolicyDialog');
    log('----隐私协议-------$privacyPolicyDialog');
    if (privacyPolicyDialog==null||privacyPolicyDialog == false) {
      dialogShow(Get.context!);
    }
  }
}
